home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / FloatOption.java < prev    next >
Text File  |  1998-09-08  |  936b  |  40 lines

  1. package com.symantec.itools.frameworks.application.commandline;
  2.  
  3. /**
  4.  * @author Symantec Internet Tools Division
  5.  * @version 1.0
  6.  * @since VCafe 3.0
  7.  */
  8.  
  9. public abstract class FloatOption 
  10.     extends SingleOption
  11. {
  12.     protected FloatOption()
  13.     {
  14.     }
  15.     
  16.     protected FloatOption(String[] flags)
  17.     {
  18.         super(flags);        
  19.     }
  20.  
  21.     /**
  22.      * @param args TODO
  23.      * @param startIndex TODO
  24.      * @exception com.symantec.itools.frameworks.application.commandline.MissingArgumentsException
  25.      * @since VCafe 3.0
  26.      */    
  27.     protected float getFloat(String[] args, int startIndex)
  28.         throws MissingArgumentsException
  29.     {
  30.         try
  31.         {
  32.             return (Float.valueOf(args[startIndex + 1]).floatValue());
  33.         }
  34.         catch(ArrayIndexOutOfBoundsException ex)
  35.         {
  36.             throw new MissingArgumentsException(args[startIndex]);
  37.         }
  38.     }
  39. }
  40.